﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MyOA.BLL;
using MyOA.Model;

namespace MyOA.UI
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        MyOAManage manage = new MyOAManage();

        
        /// <summary>
        /// 根据登陆帐号来获取此帐户的类别
        /// </summary>
        /// <param name="loginId">登陆帐号</param>
        /// <returns>返回用户类别信息</returns>
        public RoleInfo getRoleInfoByLoginId(string loginId)
        {
            return manage.getRoleInfoByLoginId(loginId);
        }


        protected void Page_Load(object sender, EventArgs e)
        {
           
            if (!IsPostBack)
            {
                if (Session["loginId"] != null)
                {
                    string loginId = (string)Session["loginId"];

                    RoleInfo loginRoleInfo = getRoleInfoByLoginId(loginId);

                    Session["loginRoleInfo"] = loginRoleInfo;//存入登陆帐号的角色信息

                    //  lblLoginId.Text = loginUser.LoginId;

                }
                else
                {
                    Response.Redirect("Login.aspx");
                }
            }
        }

        
    }
}
